Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using UNDEF_P macro #6721

Merged
merged 1 commit into from
Nov 16, 2022
Merged

Using UNDEF_P macro #6721

merged 1 commit into from
Nov 16, 2022

Conversation

S-H-GAMELINKS
Copy link
Contributor

MRI(CRuby) has theese Qundef check code.

if (result == Qundef) return Qnil;

But, theese check UNDEF_P macro already define.
Using and replace theese Qundef check code to UNDEF_P that is more simple. I think.

gc.c Outdated
@@ -4673,7 +4673,7 @@ id2ref(VALUE objid)
}
}

if ((orig = id2ref_obj_tbl(objspace, objid)) != Qundef &&
if (!UNDEF_P((orig = id2ref_obj_tbl(objspace, objid))) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 12 excess parentheses in 8 files.

Suggested change
if (!UNDEF_P((orig = id2ref_obj_tbl(objspace, objid))) &&
if (!UNDEF_P(orig = id2ref_obj_tbl(objspace, objid)) &&

@S-H-GAMELINKS
Copy link
Contributor Author

S-H-GAMELINKS commented Nov 13, 2022

@nobu
Thanks for your review.
I've fixed it(in a41e702)

@nobu nobu merged commit 1f4f6c9 into ruby:master Nov 16, 2022
@S-H-GAMELINKS S-H-GAMELINKS deleted the using_undeg_p_macro branch November 16, 2022 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants